﻿using CSharpDay05__MVC_Intro_.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace CSharpDay05__MVC_Intro_.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            List<Movie> movies = new List<Movie>()
            {
                new Movie() { Id = 1, Title = "Star Wars IV", Year = 1977, Rating = Rating.PG },
                new Movie() { Id = 2, Title = "Gumby", Year = 1995, Rating = Rating.G },
                new Movie() { Id = 3, Title = "Alien", Year = 1979, Rating = Rating.R },
                new Movie() { Id = 4, Title = "Rambo First Blood: Part 2", Year = 1984, Rating = Rating.PG13 }
            };
            //Actor model = new Actor(); //CANNOT DO THIS
            Actor.Name = "Brad Pitt";
            string result = Movie.ShowInfo();
            //movies[1].ShowInfo(); //CANNOT DO THIS because ShowInfo is static

            //Show the view with the same name as the Action --- "Index"
            return View(movies);
        }

        public ActionResult About()
        {
            Movie movie = new Movie();
            movie.Title = "Star Wars IV";
            movie.Year = 1977;
            movie.Rating = Rating.PG;
            movie.Id = 1;

            return View(movie);
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }
    }
}